const path = require("path");
const fs = require("fs").promises;
// const co = require("co");

async function readFile(url) {
  let fileUrl = await fs.readFile(url, "utf8");
  let content = await fs.readFile(path.resolve(__dirname, fileUrl), "utf8");
  return content;
}

let p = readFile(path.resolve(__dirname, "fileUrl.txt"));

p.then((data) => {
  console.log(data);
});

// const {value,done} = it.next()

// value.then((data)=>{
//     let {value,done} =  it.next(data)
//     value.then((data)=>{
//         let {value,done} =  it.next(data)
//         console.log(value,done)
//     })
// })
